Skip to content

feat: Add C ABI for embedded seekdb (multi‑language SDKs)#135

Closed
dengfuping wants to merge 523 commits intooceanbase:masterfrom
dengfuping:feat/embedded-mode
Closed

feat: Add C ABI for embedded seekdb (multi‑language SDKs)#135
dengfuping wants to merge 523 commits intooceanbase:masterfrom
dengfuping:feat/embedded-mode

Conversation

@dengfuping
Copy link
Copy Markdown
Collaborator

@dengfuping dengfuping commented Jan 28, 2026

Task Description

Solution Description

  • Architecture Design:
Language Bindings (Node.js, Python, Rust, Go)
           │
           ▼
    SeekDB C ABI (seekdb.h/seekdb.cpp)
           │
           ▼
    OceanBase Core (liboceanbase.so)
  • Source Code Directory (src/include/)
src/include/
├── seekdb.h                          # Public C API header file
│                                     # - All function declarations
│                                     # - Type definitions (SeekdbHandle, SeekdbResult, etc.)
│                                     # - Data structures (SeekdbBind, SeekdbField)
│                                     # - MySQL C API compatible interface
│
├── seekdb.cpp                        # C ABI implementation (~4800 lines)
│                                     # - Global initialization (seekdb_open/close)
│                                     # - Connection management
│                                     # - Query execution & Result set operations
│                                     # - Prepared Statement API
│                                     # - Signal handling & Stack management
│
├── CMakeLists.txt                    # Build configuration for libseekdb.so

Test Directory (unittest/include/)

unittest/include/
├── test_seekdb.cpp                   # C++ unit test suite (comprehensive)
│                                     # - Tests all C API functions directly
│                                     # - Complete API coverage
│
├── nodejs/                           # Node.js FFI binding (koffi)
│   ├── seekdb.js                    # FFI wrapper
│   ├── test.js                      # Test suite
│   └── test.sh                      # Test execution script
│
├── nodejs_napi/                      # Node.js N-API binding (native addon)
│   ├── seekdb.cpp                   # N-API C++ implementation
│   ├── test.js                      # Test suite
│   └── test.sh                      # Test execution script
│
├── python/                           # Python binding (ctypes)
│   ├── seekdb.py                    # FFI wrapper
│   ├── test.py                      # Test suite
│   └── test.sh                      # Test execution script
│
├── rust/                             # Rust FFI binding
│   ├── src/
│   │   ├── lib.rs                   # FFI bindings
│   │   └── test.rs                  # Test suite
│   └── test.sh                      # Test execution script
│
└── go/                               # Go binding (cgo)
    ├── seekdb/seekdb.go              # FFI wrapper
    ├── test.go                       # Test suite
    └── test.sh                       # Test execution script

Passed Regressions

  • Unittest
  • Node.js FFI bindings
  • Node.js N-API bindings
  • Python FFI bindings
  • Go FFI bindings
  • Rust FFI bindings

Build and test:

# build libseekdb library
./build.sh release --init -DBUILD_EMBED_MODE=ON --make

# unittest
make -j$(nproc) test_seekdb
cd build_release/unittest/include && ./test_seekdb

# bindings test
cd unittest/include/nodejs && bash ./test.sh
cd unittest/include/nodejs_napi && bash ./test.sh
cd unittest/include/python && bash ./test.sh
cd unittest/include/go && bash ./test.sh
cd unittest/include/rust && bash ./test.sh

Upgrade Compatibility

  • Compatible

Other Information

Release Note

  • 🆕 Add C ABI for embedded seekdb (multi‑language SDKs).

obdev and others added 30 commits January 19, 2026 16:07
… found in extra_access_ctx_

Co-authored-by: fkuner <784819644@qq.com>
… sstable

Co-authored-by: footka <672528926@qq.com>
Co-authored-by: hnwyllmm <hnwyllmm@126.com>
Co-authored-by: footka <672528926@qq.com>
Co-authored-by: gaopy3 <gao.panyu@qq.com>
Co-authored-by: footka <672528926@qq.com>
Co-authored-by: gaopy3 <gao.panyu@qq.com>
Co-authored-by: hnwyllmm <hnwyllmm@126.com>
Co-authored-by: footka <672528926@qq.com>
Co-authored-by: gaopy3 <gao.panyu@qq.com>
…est parsing

Co-authored-by: fkuner <784819644@qq.com>
…text

Co-authored-by: fkuner <784819644@qq.com>
Co-authored-by: footka <672528926@qq.com>
Co-authored-by: gaopy3 <gao.panyu@qq.com>
…ding for overly long data.

Co-authored-by: shenyunlong.syl <ylshen0919@gmail.com>
Co-authored-by: JLY2015 <1623359870@qq.com>
Co-authored-by: footka <672528926@qq.com>
Co-authored-by: gaopy3 <gao.panyu@qq.com>
Co-authored-by: gys-git <1243106322@qq.com>
…ollection

Co-authored-by: fkuner <784819644@qq.com>
…error tests

Co-authored-by: fkuner <784819644@qq.com>
…mplified test

Co-authored-by: fkuner <784819644@qq.com>
Co-authored-by: footka <672528926@qq.com>
Co-authored-by: LINxiansheng <wangzelin19961202@gmail.com>
Co-authored-by: LesinLi <15649865651@163.com>
…ng rewrite

Co-authored-by: fkuner <784819644@qq.com>
Co-authored-by: hnwyllmm <hnwyllmm@126.com>
Co-authored-by: fkuner <784819644@qq.com>
Co-authored-by: fkuner <784819644@qq.com>
Co-authored-by: Junkrat77 <2367392933@qq.com>
@dengfuping dengfuping force-pushed the feat/embedded-mode branch 24 times, most recently from 5bcda7f to f08fdf8 Compare April 23, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Stable C ABI for embedded seekdb (multi‑language SDKs)

2 participants